Enterprise Objects Framework Release 1.1 Copyright ã1995 by NeXT Computer, Inc.  All Rights Reserved.

EODatabaseChannelNotification
(informal protocol)

Category Of:	NSObject

Declared In:	eoaccess/EODatabaseChannel.h

Category Description

This category on NSObject declares the awakeForDatabaseChannel: method. An EODatabaseChannel sends this message to any enterprise object that responds to it after fetching the object from the database. This allows the enterprise object to perform whatever additional initialization it needs.

Note that a channel sends this message as each object is fetched. There's no standard notification to objects after the entire set has been fetched. If you need such a notification and are working at the database level, you can send a message after your fetch loop to every enterprise object fetched (see the EODatabaseChannel class specification). If you're working with a data source object, you can send a message to every enterprise object fetched after sending fetchObjects to your data source object. With an EOController you can define a delegate that implements the controller:didFetchObjects: method to notify enterprise objects after they've all been fetched. In all three cases, however, you define the form of the notification method.

Instance Methods

awakeForDatabaseChannel:

- (void)awakeForDatabaseChannel:(EODatabaseChannel *)channel

Informs the receiver that it's been fetched from a database by channel. The receiver can perform any extra initialization it needs, except for fetching other enterprise objects with channel. channel is in the process of fetching when this method is sent, so any database operations the receiver needs to perform must be postponed. The receiver can, however, create an object that will be fetched later (see the EOFault class specification) or possibly use a different EODatabaseChannel to perform its own fetches.

This message is sent each time the receiver is fetched, not just the first time. The receiver should be sure it needs to act; for example, if an instance variable has a non-nil value it probably doesn't need to be reinitialized.